#@head() #@header()
<title>客户列表</title>
#@aside()
<div class="content-wrapper">
	<section class="content">
		
			<div class="col-md-12">
				<div class="box box-info">
					<div class="box-header with-border">
						<h3 class="box-title">搜索客户</h3>
					</div>
					<!-- /.box-header -->
					<!-- form start -->

						<div class="box-body">
							<div class="input-group margin">
				                <input type="text" class="form-control">
				                <div class="input-group-btn">
				                  <button type="button" class="btn btn-default dropdown-toggle"> 搜 索 </button>
				                </div>
				             </div>
						</div>
				</div>
			</div>
		
		
		<div class="col-xs-12">
				<div class="box">
					<div class="box-header">
						<h3 class="box-title" style="margin-left: 10px;">客户列表</h3>
						<div class="box-body">
							<table id="example1" class="table table-striped">
								<thead>
									<tr>
										<th>用户ID</th>
										<th>用户名</th>
										<th>真实姓名</th>
										<th>最近投资</th>
										<th>客服编号</th>
										<th>客服姓名</th>
										<th>加入时长</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									
									<tr>
										<td>1 </td>
										<td>加东大 </td>
										<td>王莹</td>
										<td>2017-4-18  投资金额 1000.00</td>
										<td>0001</td>
										<td>王英</td>
										<td>14526天</td>
										<td>
										<!-- <a href="" class="btn btn-success">编辑</a>  -->
										<a href="#(path)/page/client-view-signview" class="btn btn-info">查看</a> 
										<a data-id="" class="btn btn-danger">删除</a></td>
									</tr>
									
								</tbody>
							</table>
						</div>
				
					</div>
				</div>
			</div>
		</div>
	</section>
		
</div>
#@footer()
<script>
$(function(){ 
       $("#clientid").select2({
               ajax: {
                   url: "#(path)/client/search",
                   dataType: 'json',
                   delay: 250,
                   data: function(params) {
                       return {
                           key: params.term
                       };
                   },
                   processResults: function(data, params) {
                       console.log(data); 
                       return {
                           results: data
                       };
                   },
                   cache: true
               },
               minimumInputLength: 1
        });
      
       $(".user").select2({
              ajax: {
                  url: "#(path)/client/search",
                  dataType: 'json',
                  delay: 250,
                  data: function(params) {
                      return {
                          key: params.term
                      };
                  },
                  processResults: function(data, params) {
                      console.log(data); 
                      return {
                          results: data
                      };
                  },
                  cache: true
              },
              minimumInputLength: 1
    });
});
</script>
<script>
	$(document).ready(function() {
		$(".btn-danger").click(function() {
			var id = $(this).data("id");
			layer.confirm('确认删除？', {
				btn : [ '删除', '取消' ]
			}, function() {
				ajax("#(path)/client/del",{"id":id},function(data){
					layer.msg(data.msg, {icon:data.type},function(){
					location.href="#(path)/client/list"
					});
				});
			}, function() {
				layer.msg('已取消！', {
					icon : 1
				});
			});
		});
	});
</script>
</body>
</html>

